<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/10
 * Time: 14:00
 */

namespace app\flower\model;
use think\Model;

class FlowerFlowertypeModel extends Model
{
    /**
     * dottime读取器
     * 在查询的时候将时间戳转换成时间格式
     */
    protected function getDottimeAttr($dottime){
        if(!empty($dottime)){
            return date('Y-m-d H:i:s',$dottime);
        }else{
            return $dottime;
        }
    }

    /**
     * @param $knows
     * knows 读取器
     * 在查询的时候将富文本内容进行html实体化
     */
    protected function getKnowsAttr($knows){

        if(!empty($knows)){
            return htmlspecialchars_decode($knows);
        }else{
            return $knows;
        }
    }

    /**
     * @param $service
     * @return string
     */
    protected function getServiceAttr($service){
        if(!empty($service)){
            return htmlspecialchars_decode($service);
        }else{
            return $service;
        }
    }
}